package book;

public class bookList {
    //书架

    private static book[] books;//存放书籍
    private static final int DEFAULT_SIZE = 10;

    private static int usedSize;//有效书籍的个数

    public bookList(){
        this.books = new book[DEFAULT_SIZE];
        books[0] = new book("三国演义","罗贯中",19,"武侠");
        books[1] = new book("西游记","吴承恩",20,"神话");
        books[2] = new book("红楼梦","曹雪芹",22,"小说");
        this.usedSize = 3;
    }

//获取当前有效数据
    public static int getUsedSize() {
        return usedSize;
    }
//更改有效数据
    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    //...还有待补充

    public static book getBook(int pos){
        return books[pos];
    }
    public static void setBooks(int pos, book book){
        books[pos] = book;
    }
}
